function sqls() {
    this.search_room_info = function(start_date, end_date, remain) {
        return `select r.room_id, h.hotel_name hotel_name, r1.room_name room_name, avg(price) price
                from room_info r
                inner join room_type r1 on r.room_id = r1.room_id
                inner join hotel h on r1.hotel_id = h.hotel_id
                where r.date >= ${start_date} and r.date <= ${end_date}
                group by r1.room_id
                having min(r.remain) >= ${remain}
                order by avg(price)`
    }
    this.take_an_order = function(room_id, start, end, amount, payment, create_date, customer_id) {
        return `insert into \`order\` values (null, ${room_id}, ${start}, ${end}, ${amount}, ${payment}, ${create_date}, ${customer_id});`
    }
}

module.exports = sqls